<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>审核列表</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" type="text/css" href="assets/layui/css/layui.css" media="all"/>
</head>
<body> 
<div class="layui-fluid">
	<form class="layui-form" action="" method="post">
		<div class="carTable">
			<div class="layui-inline">
				<!--<input type="date" class="layui-input" name="id" id="demoReload" >-->
				<input type="text" name="title" required lay-verify="required" placeholder="搜索" autocomplete="off" class="layui-input"> 
			</div>
			<button class="layui-btn" data-type="reload">搜索</button>
			
		</div>
	</form>
	

	<table class="layui-hide" id="audit-list-table" lay-filter="audit"></table>            
	<script type="text/html" id="checkInfor">
	  	<a class="layui-btn layui-btn-xs" lay-event="pass">审 核</a>
	</script>  

</div>
<script src="assets/layui/layui.js" type="text/javascript"></script>
<script type="text/javascript" src="assets/js/all.js" ></script>
<script type="text/javascript">
	layui.use(['table','layer','laypage'],function(){
				var table = layui.table,
					layer = layui.layer,
					laypage = layui.laypage,
					$ = layui.$
					
					//审核列表页面js
					//方法级渲染
					table.render({
						elem: '#audit-list-table',
						url: 'assets/data/account.json',
						cols: [
							[{
								field: 'id',
								title: '账号',
								width: 80
							}, {
								field: 'phone',
								title: '联系方式',
								width: 130
							}, {
								field: 'name',
								title: '名称'
							}, {
								field: 'email',
								title: 'Email',
								width: 130
							}, {
								field: 'company',
								title: '企业名称'
							}, {
								field: 'sign',
								title: '身份'
							}, {
								field: 'experience',
								title: '权限'
							}, {
								//fixed: 'right',
								align: 'center',
								toolbar: '#checkInfor'
							}]
						],
						id: 'testReload',
						page: true,
						limit: 20,
						done:function(res,curr,count){//res即为你接口返回的信息,curr 是当前页，count总页数
							if(res.code == 0){
								layer.msg(res.msg);
							}
							if(res.code == 1){
								
							}
						}
					});
				
					var $ = layui.$,
						active = {
							reload: function() {
								var demoReload = $('#demoReload');
				
								//执行重载
								table.reload('testReload', {
									page: {
										curr: 1 //重新从第 1 页开始
									},
									where: {
										key: {
											id: demoReload.val()
										}
									}
								});
							}
						};
				
					$('.carTable .layui-btn').on('click', function() {
						var type = $(this).data('type');
						active[type] ? active[type].call(this) : '';
					});
				
					//监听工具条
					table.on('tool(audit)', function(obj) {
						var data = obj.data;
						if(obj.event === 'pass') {
							var index = layer.open({
								type:2,
								title:'注册信息',
								content:'resInfor.html'
							});
							layer.full(index);
						}
					});
		})
</script>

</body>
</html>